mathematical derivation of consumers equilibrium